/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#ifndef MK_RTSP_STREAM_SOURCE_H
#define MK_RTSP_STREAM_SOURCE_H
#include <MkMedia/MkMediaSource.h>
#include "MkRtp/MkRtpUtil.h"

class MkApi CMkRtspStreamSource : public CMkMediaSource
{
public:
    CMkRtspStreamSource(const MkMediaSourceType& SourceType);
    virtual ~CMkRtspStreamSource();

    Uint32 ParseH264RtpPacket(const CMkRtpPacket& RtpPacket);
    Uint32 ParseH265RtpPacket(const CMkRtpPacket& RtpPacket);
    Uint32 ParseAacRtpPacket(const CMkRtpPacket& RtpPacket);
private:
    MkEsPacket                      m_VideoEsPacket;
    MkEsPacket                      m_AudioEsPacket;
    Uint8*                          m_pFuBegin;
    Uint32                          m_nFuLen;

    Uint8*                          m_pMallocBuf;
    Uint8*                          m_pEsBuffer;
    Uint32                          m_nEsMaxLen;
    Uint32                          m_nEsOffset;
};

#endif